package com.sf.fy.uav.applet.operate.controller;

import com.sf.fy.uav.common.enums.RewardTypeEnum;
import com.sf.fy.uav.common.response.operational.ActivityRewardResponse;
import com.sf.fy.uav.common.response.operational.BannerResponse;
import com.sf.fy.uav.common.utils.Rs;
import com.sf.fy.uav.entity.Activity;
import com.sf.fy.uav.rest.BannerRest;
import com.sf.fy.uav.order.controller.FeedbackRest;
import com.sf.fy.uav.rest.ActivityRest;
import com.sf.fy.uav.rest.InvitationCodeRest;
import io.swagger.annotations.Api;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import io.swagger.v3.oas.annotations.Parameter;

/**
 * @author LTQ
 */
@RestController
@Api(tags = "banner管理")
@RequestMapping("/sys/banner/")
public class SysBannerController {

    @Autowired
    private FeedbackRest feedbackRest;

    @Autowired
    private BannerRest bannerRest;

    @Autowired
    private ActivityRest activityRest;


    @Autowired
    private InvitationCodeRest invitationCodeRest;

    @Operation(tags = "获取banner", description = "获取banner")
    @GetMapping("get-banner")
    @CrossOrigin
    public Rs<List<BannerResponse>> getBanners() {
        return Rs.success(bannerRest.getBanners());
    }


//    @GetMapping("get-banner-info")
//    @Parameter(name = "type", description = "banner类型;成交奖励传0")
//    @Operation(tags = "获取banner页面信息", description = "获取banner页面信息")
//    public Rs<Object> getBannersInfo(@RequestParam Integer type) {
//        ActivityRewardResponse activityRewardResponse = new ActivityRewardResponse();
//        if (type.equals(RewardTypeEnum.TRANSACTION_REWARD.getType())) {
//            Activity activity = activityRest.getSettings(type);
//            if (!ObjectUtils.isEmpty(activity)) {
//                activityRewardResponse.setRewardAmount(activity.getRewardAmount());
//            }
//            return Rs.success(activityRewardResponse);
//        }
//        return Rs.success(null);
//    }


}
